package com.InterestingExercises;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;

public class WangJiaWei {
    public static final String WANGJIAWEI = "王嘉伟";

    public static void main(String[] args) throws IOException {
        ArrayList<String> nextStage = new ArrayList<>();
        String teacherName = WANGJIAWEI;
        nextStage.add(teacherName);
        if (nextStage.contains(WANGJIAWEI)) {
            String str = "Holy shit, I am going to be crazy!";
            byte[] bytes = str.getBytes();
            FileOutputStream fileOutputStream = null;
            try {
                File parent = new File("C:\\NaiNaiDe");
                File file = null;
                if (!parent.exists()) {
                    parent.mkdirs();
                    file = new File(parent, "judgement.txt");
                }
                fileOutputStream = new FileOutputStream(file);
                fileOutputStream.write(bytes);
                System.out.println("已经创建C:\\NaiNaiDe\\judgement.txt");
            } catch (IOException e) {
                e.printStackTrace();
            } finally {
                if (fileOutputStream != null) {
                    try {
                        fileOutputStream.close();
                    } catch (IOException e) {
                        throw new RuntimeException(e);
                    }
                }
            }
        }
    }
}
